package codeGenerator.visitor;

import model.AttributeElement;
import model.ClasseElement;
import model.CompositeElement;
import codeGenerator.JavaFileWriter;

public class ImportPrintingVisitor implements IMetaModelVisitor {

	protected JavaFileWriter mWriter;

	@Override
	public void visitClasseElement(ClasseElement aClasseElement) {
		String classPackage = aClasseElement.getPackage();

		// TODO traitement package intelligent.
		this.mWriter.println("package " + classPackage + ";");
	}

	@Override
	public void visitAttributeElement(AttributeElement anAttributeElement) {
		// Nothing to do
	}

	@Override
	public void visitCompositeElement(CompositeElement aCompositeElement) {

		String compositePackage = aCompositeElement.getPackage();

		// TODO traitement package intelligent.
		this.mWriter.println("import " + compositePackage + ";");
	}

	public void setWriter(JavaFileWriter mWriter) {
		this.mWriter = mWriter;
	}

}
